package cn.stylefeng.guns.dao;

import cn.stylefeng.guns.pojo.Course;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface CourseDao extends BaseMapper<Course> {

    @Select("SELECT c.id,\n" +
            "\tc.t_course_name,\n" +
            "\tc.t_course_type_id,\n" +
            "\tc.t_level,\n" +
            "\tc.t_price,\n" +
            "\tc.t_teacher_id,\n" +
            "\tc.t_service_id,\n" +
            "\tc.t_img_url,\n" +
            "\tc.t_course_introduce,\n" +
            "\tc.t_prompt,\n" +
            "\tc.t_try_listen,\n" +
            "\tc.t_status,\n" +
            "\tc.t_update_date,\n" +
            "\tc.t_update_man FROM tb_course c WHERE c.id=#{id}")
    Course findById(@Param("id") Integer id);
}
